#!/usr/bin/perl

require "./mailadmin-lib.pl";
&ReadParse();

my ($dname, @ulist, $err_msg);

$dname = $in{'dname'};
@ulist = split("\0", $in{'vuser'});

unless ($dname)
{
    $err_msg = $text{'msg_dname_empty'};
    goto ERROR_OUT;
}

unless ($in{'vuser'})
{
    $err_msg = $text{'msg_uname_empty'};
    goto ERROR_OUT;
}

$err_msg = &delete_user(\@ulist, $dname);
if ($err_msg)
{
    goto ERROR_OUT;
}

&redirect("list_user.cgi?dname=$in{'dname'}");

ERROR_OUT:;

my (@headp, @footp);
@headp = ($text{'error'}, "");
@footp = ("list_user.cgi?dname=$in{'dname'}", $text{'back_lsuser'});
&mail_error(\@headp, \@footp, $text{'err_title_save_delete_user'}, $err_msg);


